package com.shiyingzi.security.service.impl;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.shiyingzi.common.PageUtils;
import com.shiyingzi.common.PageableData;
import com.shiyingzi.common.ResponseData;
import com.shiyingzi.security.dao.RoleDao;
import com.shiyingzi.security.model.Role;
import com.shiyingzi.security.service.IRoleService;

@Service(IRoleService.BEAN_ID)
public class RoleServiceImpl  extends ServiceImpl<RoleDao, Role> implements IRoleService {
	
	@Autowired
	private RoleDao roleDao;	
	@Override
	public ResponseData insertRole(Role role) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public ResponseData updateRole(Role role) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public ResponseData deleteRole(String id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public ResponseData Role(String id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public PageableData<Role> queryUserList(int page, int limit, String roleName) {

		Page<Role> mypage = new Page<Role>();
		mypage.setCurrent(page);
		mypage.setSize(limit);
		Role ac =new Role();
		if(!StringUtils.isEmpty(roleName)){
			ac.setRoleName(roleName);
		}
		return PageUtils.tableDataDto(selectPage(mypage,new EntityWrapper<Role>(ac).orderBy("createTime")));
	}

}
